<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="../js/jquery-1.6.min.js" type="text/javascript"></script>
<style type="text/css">
.anntitle{
	font-weight: bold;
	color: #FF9900;
}
.anndate{
	color: #888;
	font-size: 0.7em;
	font-style: normal;
	padding: 5px 5px;
	line-height: 2.4em;
}
</style>
<title></title>
</head>
<body>
	<div align="center" class="anntitle">${ann.title}</div>
	<div align="center" class="anndate">发布日期:${ann.publishdate}</div>
	<div>${ann.message}</div>
	<c:if test="${ann.receipt eq 2}">
		<script>
			var receiptSelection;
			function readSubmit(){
				$.ajax({
					type: 'POST',
					url: "../announcement/readedAnn.html",
					data: {annId:${ann.id},receiptSelectionId:receiptSelection},
					dataType: "text",
					success: function(result){
						if(result == "OK"){
							parent.refreshSelf();
						}else{
							alert("服务异常!");
						}
					}
				});
			}
		</script>
			<table>
				<c:forEach var="varI" items="${ann.receiptItems}">
				<tr>
					<td><input type=radio name=tmpradioname onclick="receiptSelection=${varI.id}"/></td>
					<td>${varI.title}</td>
					<td>${varI.description}</td>
				</tr>
				</c:forEach>
				<tr>
					<td colspan="3">
						<input type=button value="提 交" onclick="readSubmit()"/>
					</td>
				</tr>
			</table>
	</c:if>
	<c:if test="${ann.receipt eq 1}">
		<script>
			function readSubmit(){
				$.ajax({
					type: 'POST',
					url: "../announcement/readedAnn.html",
					data: {annId:${ann.id},receiptMsg:$("#receiptMsg").val()},
					dataType: "text",
					success: function(result){
						if(result == "OK"){
							parent.refreshSelf();
						}else{
							alert("服务异常!");
						}
					}
				});
			}
		</script>
		<table>
				<tr>
					<td>回复:</td>
					<td><textarea id="receiptMsg"></textarea></td>
				</tr>
				<tr>
					<td colspan="2">
						<input type=button value="回 复" onclick="readSubmit()"/>
					</td>
				</tr>
		</table>
	</c:if>
	<c:if test="${ann.receipt eq 0}">
		<script>
			function readSubmit(){
				$.ajax({
					type: 'POST',
					url: "../announcement/readedAnn.html",
					data: {annId:${ann.id}},
					dataType: "text",
					success: function(result){
						if(result == "OK"){
							parent.refreshSelf();
						}else{
							alert("服务异常!");
						}
					}
				});
			}
		</script>
		<table>
			<tr>
				<td><input type=button value="已 读" onclick="readSubmit()"/></td>
			</tr>
		</table>
	</c:if>
</body>
</html>